package org.kornero.example;

import android.app.Activity;
import android.graphics.PixelFormat;
import android.opengl.GLSurfaceView;
import android.os.Bundle;
import android.view.View;
import com.kornero.util.sensor.accelerometr.Rotation;

public class MainActivity extends Activity {
    private static final String TAG = MainActivity.class.getSimpleName();

    private View view;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        view = new BubbleView(this);
//        view = new GLView(this);
        setContentView(view);

        getWindow().setFormat(PixelFormat.TRANSLUCENT);
    }

    @Override
    protected void onPause() {
        super.onPause();
        if (view instanceof GLSurfaceView) {
            ((GLSurfaceView) view).onPause();
        }

        // Stop updates to save power while app paused.
        Rotation.getInstance().onPause(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        if (view instanceof GLSurfaceView) {
            ((GLSurfaceView) view).onResume();
        }

        // Start updates for one or more sensors.
        Rotation.getInstance().onResume(this);
    }
}
